/*
 * Powered By cuichen
 * Since 2014 - 2018
 */package com.seeyoui.kensite.bussiness.orderlang.inbound.service;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seeyoui.kensite.common.base.service.BaseService;

import java.util.*;

import com.seeyoui.kensite.common.base.domain.EasyUIDataGrid;
import com.seeyoui.kensite.common.base.service.BaseService;
import com.seeyoui.kensite.common.exception.CRUDException;
import com.seeyoui.kensite.common.util.*;
import com.seeyoui.kensite.common.constants.StringConstant;
import com.seeyoui.kensite.bussiness.orderlang.inbound.domain.Inbound;
import com.seeyoui.kensite.bussiness.orderlang.inbound.persistence.InboundMapper;

/**
 * Inbound
 * @author cuichen
 * @version 2.0
 * @since 1.0
 * @date 2018-02-27
 */

@Service
public class InboundService extends BaseService {
	
	@Autowired
	private InboundMapper inboundMapper;

	/**
	 * 根据ID查询单条数据
	 * @param id
	 * @return
	 * @throws CRUDException
	 */
	public Inbound findOne(String id) throws CRUDException{
		return inboundMapper.findOne(id);
	}
	
	/**
	 * 查询数据集合
	 * @param inbound
	 * @return
	 * @throws CRUDException
	 */
	public List<Inbound> findList(Inbound inbound) throws CRUDException {
		return inboundMapper.findList(inbound);
	}
	
	/**
	 * 查询所有数据集合
	 * @param inbound
	 * @return
	 * @throws CRUDException
	 */
	public List<Inbound> findAll(Inbound inbound) throws CRUDException {
		return inboundMapper.findAll(inbound);
	}
	
	/**
	 * 查询数据总数
	 * @param inbound
	 * @return
	 * @throws CRUDException
	 */
	public int findTotal(Inbound inbound) throws CRUDException {
		return inboundMapper.findTotal(inbound);
	}
	
	/**
	 * 查询数据总数排除当前数据
	 * @param inbound
	 * @return
	 * @throws CRUDException
	 */
	public int findExTotal(Inbound inbound) throws CRUDException {
		return inboundMapper.findExTotal(inbound);
	}
	
	/**
	 * 数据新增
	 * @param inbound
	 * @throws CRUDException
	 */
	public void save(Inbound inbound) throws CRUDException{
		inbound.preInsert();
		inboundMapper.save(inbound);
	}
	
	/**
	 * 数据修改
	 * @param inbound
	 * @throws CRUDException
	 */
	public void update(Inbound inbound) throws CRUDException{
		inbound.preUpdate();
		inboundMapper.update(inbound);			
	}
	
	/**
	 * 数据删除
	 * @param listId
	 * @throws CRUDException
	 */
	public void delete(List<String> listId) throws CRUDException {
		inboundMapper.delete(listId);
	}
	
	/**
	 * 数据假删除
	 * @param inbound
	 * @throws CRUDException
	 */
	public void remove(Inbound inbound) throws CRUDException{
		inbound.preUpdate();
		inboundMapper.remove(inbound);			
	}
	
}